﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>	
		<title>$!{domainLabel}-管理</title>
		<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
		<meta http-equiv="imagetoolbar" content="false" />
		<meta http-equiv="content-language" content="UTF-8" />
		<meta http-equiv="MSThemeCompatible" content="yes" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
		<meta http-equiv="expires" content="-1" />
		<meta name="mssmarttagspreventparsing" content="true" />
		<meta name="revisit-after" content="7 days" />
		<meta name="classification" content="religion" />
		<meta name="distribution" content="global" />
		<meta name="rating" content="general" />
		<meta name="author" content="" />
		<meta name="publisher" content="" />
		<meta name="copyright" content="" />
		<meta name="keywords" content="" />
		<meta name="robots" content="index,follow" />
		<meta name="allow-search" content="yes" />
		<meta name="audience" content="all" />
		<meta name="dc.language" scheme="rfc1766" content="UTF-8" />
		<meta name="expires" content="never" />
		<meta name="abstract" content="abstract of page" />
		<meta name="security" content="public" />

$html.easyjweb()

##set ($domain = $!domainName.toLowerCase())
\#macro(orderPic $type)
\#if ($orderBy.equals($type))<img src="/images/orderby/${orderType}.gif" style="border:0;width:13px;height:4px;" border="0" />\#end
\#end

<script type="text/javascript">
//全部选中函数
function selectAll(){
	var f=document.getElementById("ListForm");
	var d=f.getElementsByTagName("input");
	for(var i=0;i<d.length;i++){
		if(d[i].type=="checkbox"&&d[i].name=="ids"){
			d[i].checked=true;
		}
	}
}
//反向选中函数
function selectInvertion(){
	var f=document.getElementById("ListForm");
	var d=f.getElementsByTagName("input");
	for(var i=0;i<d.length;i++){
		if(d[i].type=="checkbox"&&d[i].name=="ids"){
			d[i].checked==false?d[i].checked=true:d[i].checked=false;
		}
	}
}
//全部不选中函数
function selectNone(){
	var f=document.getElementById("ListForm");
	var d=f.getElementsByTagName("input");
	for(var i=0;i<d.length;i++){
		if(d[i].type=="checkbox"&&d[i].name=="ids"){
			d[i].checked=false;
		}
	}
}
//选中当前项函数
function selectOne(id){
	var f=document.getElementById("ListForm");
	var d=f.getElementsByTagName("input");
	for(var i=0;i<d.length;i++){
		if(d[i].type=="checkbox"&&d[i].name=="ids"){
			if(d[i].value==id){
				d[i].checked==false?d[i].checked=true:d[i].checked=false;
			}
		}
	}
}
//删除选中项函数
function deleteSelected(){
	var f=document.getElementById("ListForm");
	var d=f.getElementsByTagName("input");
	f.mulitId.value="";
	for(var i=0;i<d.length;i++){
		if(d[i].type=="checkbox"&&d[i].name=="ids"){
			if(d[i].checked==true){
				f.mulitId.value+=d[i].value+",";
			}
		}
	}
	if(f.mulitId.value!=""){
	var confirm=window.confirm("真的要删除吗？");
		if(confirm){
			f.action="/ejf/$!{domain}/batchDelete"
			f.submit();
		}
	}
}
//导向至添加新$!{domainName}页面函数
function new$!{domainName}(){
	window.location.href="/ejf/$!{domain}/new";
}
//导向至查看$!{domainName}页面函数
function preview$!{domainName}(id){
	window.location.href="/ejf/$!{domain}/preview/"+id;
}
//导向至编辑$!{domainName}页面函数
function edit$!{domainName}(id){
	window.location.href="/ejf/$!{domain}/edit/"+id;
}
//导向至删除$!{domainName}页面函数
function delete$!{domainName}(id){
	var confirm=window.confirm("真的要删除吗？");
	if(confirm){
		window.location.href="/ejf/$!{domain}/delete/"+id;
	}
}
//页面排序函数
function doSort(byName){
	var f=document.getElementById("ListForm");
	(f.orderType.value==""||f.orderType.value=="asc")?f.orderType.value="desc":f.orderType.value="asc";
	f.orderBy.value=byName;
	f.submit();
}
//导向至页面函数
function gotoPage(n){
	var f=document.getElementById("ListForm");
	f.currentPage.value=n;
	f.submit();
}
</script>
		\#if($\!msg)
			<script type="text/javascript">
				alert("$\!msg");
			</script>
		\#end
</head>
<body leftmargin="0" topmargin="0" scroll="no">
	<div class="center title">
		$!{domainLabel}信息管理
	</div>
	
	<!-- information list start -->
	<div class="list">
		<form id="ListForm"  method="post" action="/ejf/$!{domain}/list">
		<div style="display:none;">
			<input type="hidden" name="id" value="$\!id" />
			<input type="hidden" name="mulitId" value="$\!mulitId" />
			<input type="hidden" name="pageSize" value="$\!pageSize" />
			<input type="hidden" name="currentPage" value="$\!currentPage"/>
			<input type="hidden" name="orderBy" value="$\!orderBy"/>
			<input type="hidden" name="orderType" value="$\!orderType"/>
		</div>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-top:1px solid #b4c6da;border-left:1px solid #b4c6da;table-layout:fixed;overflow:hidden;">
				<tr style="text-align:right;"> 
					<td colspan="#set ($columnSize=($fields.size()+2))$columnSize">
                		<input type="button" name="$!{domain}_new" value="添加" onclick="return new$!{domainName}();" />
					</td>
				</tr>
				<tr class="caption" style="height:30px;">
					<td onclick="selectInvertion();" style="cursor:pointer;" title="选择">选择</td>
#foreach ( $field in $!fields )
					<td style="word-wrap:break-word;overflow:hidden;cursor:pointer;" title="按$!{field.lable}排序" onclick="return doSort('$field.name');">$!{field.lable}#orderPic("$!{field.name}")</td>
#end
					<td style="width:400px;">操作</td>

				</tr>
\#set ($l=0)
\#foreach ($info in $list)
\#set ($l=1-$l)
				<tr class="column$\!l" onmouseover="this.style.backgroundColor='#F4F9FC';return false;" onmouseout="this.style.backgroundColor='#fff';return false;" oncontextmenu="preview$!{domainName}($\!info.$!{id.toLowerCase()});return false;" ondblclick="return edit$!{domainName}($\!info.$!{id.toLowerCase()});return false;" onclick="return selectOne($\!info.$!{id.toLowerCase()});return false;" title="双击进入编辑">
					<td><input type="checkbox" onclick="return selectOne($\!info.$!{id.toLowerCase()});" name="ids" value="$\!info.$!{id.toLowerCase()}" /></td>
#foreach($field in $!fields)
					<td title="$\!info.$!{field.name}">$\!info.$!{field.name} &nbsp;</td>
#end
					<td><input type="button" name="$!{domain}_edit" value="修改" onclick="return edit$!{domainName}($\!info.$!{id.toLowerCase()});" />&nbsp;<input type="button" name="$!{domain}_delete" value="删除" onclick="return delete$!{domainName}($\!info.$!{id.toLowerCase()});" />
					</td>
				</tr>
\#end
				<tr style="text-align : center; height:30px;vertical-align:middle;"> 
					<td colspan="#set ($columnSize=($fields.size()+2))$columnSize">
						<input type="button" onclick="return selectAll();" value="全选" />
						<input type="button" onclick="return selectInvertion();" value="反选" />
						<input type="button" onclick="return selectNone();" value="全不选" />
						<input type="button" onclick="return deleteSelected();" value="删除选中项" />
					</td>
				</tr>
			</table>
        </form>
	</div>
	<!-- information list over -->
	
	<!-- pagination start-->
	<div id="pagination">
		<ul>
			<li class="info"><span>共$\!rows条 第$\!page/$\!pages页 每页$\!pageSize条 </span></li>
		$\!pagination
		</ul>
	</div>
	<!-- pagination over -->
	
	<hr class="line" />
	
	
	<!-- copyright start -->
	<div class="copyright">
		<span>&copy; 2005-2007 EasyJF 简易JAVA开源框架</span>
	    <address>
	      <a href="http://www.easyjf.com/?refer=easyjweb-0.9.2"><img
	        src="/images/easyjweb/easyjweb.jpg" style="border:1px solid #b4c6da;" height="31" width="88"
	        alt="Powered By EasyJWeb China" /></a>
	      <a href="http://validator.w3.org/check?uri=referer"><img
	        src="/images/xhtml1.1/valid-xhtml11.png" style="border:0px solid #b4c6da;" height="31" width="88"
	        alt="Valid XHTML 1.1!" /></a>
	    </address>
	</div>
	<!-- copyright over -->
</body>
</html>

		